#include <util\AutomaticInstallation.au3>

Global $InstallProgramPath = ""
Global $InstallFolder      = ""

Global $SetupFile = "keyfinder.exe"
Global $UninstallPath = ""

Main($InstallProgramPath, $InstallFolder, $SetupFile, $UninstallPath)

Func InstallImpl($SetupPath) 
	Dim $Title = ""
	
	RunSetupFile($SetupPath)
	
	$Title = "Magical Jelly Bean Keyfinder v1.5B3"
	WinWaitActive($Title)
	Send("!O")
	Send("{Down}")
	Send("{Enter}")
	Sleep($SleepDelay)
	
	$Title = "Change Microsoft Windows XP Key"
	WinWaitActive($Title)
	;BQY68-T6R77-T7Y9D-R34FT-YDV3B
	Send("{SHIFTDOWN}BQY{SHIFTUP}68")
	Send("{SHIFTDOWN}T{SHIFTUP}6{SHIFTDOWN}R{SHIFTUP}77")
	Send("{SHIFTDOWN}T{SHIFTUP}7{SHIFTDOWN}Y{SHIFTUP}9{SHIFTDOWN}D{SHIFTUP}")
	Send("{SHIFTDOWN}R{SHIFTUP}34{SHIFTDOWN}FT{SHIFTUP}")
	Send("{SHIFTDOWN}YDV{SHIFTUP}3{SHIFTDOWN}B{SHIFTUP}")
	Send("{Enter}")
	Sleep($SleepDelay)
	
	$Title = "Windows Script Host"
	WinWaitActive($Title)
	Send("{Enter}")
    Sleep($SleepDelay)	
	
	$Title = "Change Microsoft Windows XP Key"
	WinWaitActive($Title)
	Send("{Tab}")
	Send("{Enter}")
	Sleep($SleepDelay)	
	
	$Title = "Magical Jelly Bean Keyfinder v1.5B3"
	WinWaitActive($Title)
	Send("!F")
	Send("X")
	Sleep($SleepDelay)

	WinWaitClose($Title)

	Return True
EndFunc

Func UninstallImpl($UninstallPath)
	Return True
EndFunc




